import time
import threading  # 引入线程


def sing():
    for i in range(5):
        print('唱')
        time.sleep(1)


def dance():
    for i in range(5):
        print('跳')
        time.sleep(1)


def main():
    t1 = threading.Thread(target=sing)  # target参数为目标函数
    t2 = threading.Thread(target=dance)
    t1.start()  # 启动线程
    t2.start()
    thread_list = threading.enumerate()  # 所有线程列表
    print(thread_list)
    len_thread_list = len(thread_list)  # 线程数
    print(len_thread_list)


if __name__ == '__main__':
    main()
